Filters
Filters can be applied to queries by editing the JSON body of API requests. Filters available in the API vary for indicator category and are all optional. If the filter syntax of a request is not recignised by the API, the query will ignore the filter.
Before filtering any given attribute, ensure that the respective parameter for that filter has been selected. For example, for province or territory filtering, the query string of the API endpoint must specify geo=provinces_territories, such that the API can query the required table/aggregation in the Data Hub:
https://lmic-datahub-prod-gw-d6ow9n6v.uc.gateway.dev/lmi?geo=provinces_territories
Additionally, before filtering, add the following header to let the API know to expect a JSON body in the request:
--header 'Content-Type: application/json'
Table of Filters
Note that where a table record is "n/a" the parameter is used for that given indicator category.
| Filter | Description | Accepted Values - Standard Indicators | Accepted Values - Job Postings | Accepted Values - Work Requirements |
|---|---|---|---|---|
| geo | Can filter by a number of geographic settings | {"province_territory":[“ON”, “AB”]}, {"economic_region":["Montréal"]}, {"cma":["Montréal"]} | {"province_territory":[“ON”, “AB”]}, {"economic_region":["Montréal"]}, {"cma":["Montréal"]}, {"census_division":["Montréal"]} | {"province_territory":[“ON”, “AB”]}, {"economic_region":["Montréal"]}, {"cma":["Montréal"]}, {"census_division":["Montréal"]} |
| noc | Filter by NOC | {"noc" = ["2123","2344"]}, {"noc"=["4']} | {"noc" = ["2123","2344"]}, {"noc"=["4']} | {"noc" = ["2123","2344"]}, {"noc"=["4']} |
| naics | Filter by NAICS | "naics" = {[23, 35]} | n/a | n/a |
| work_requirement | Filter by Work Requirement | n/a | n/a | “Data Analysis” |